//package com.xiguaji.tiktok.task.ranking.repository.impl;
//
//import com.xiguaji.boot.toolkit.DateTimeUtils;
//import com.xiguaji.tiktok.task.ranking.model.RankingFollowers;
//import com.xiguaji.tiktok.task.ranking.repository.RankingFollowersExtRepository;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.jdbc.core.BatchPreparedStatementSetter;
//import org.springframework.jdbc.core.JdbcTemplate;
//
//import java.sql.PreparedStatement;
//import java.sql.SQLException;
//import java.util.List;
//
//public class RankingFollowersExtRepositoryImpl implements RankingFollowersExtRepository {
//
//    @Autowired
//    JdbcTemplate jdbcTemplate;
//
//    @Override
//    public void bathSave(List<RankingFollowers> rankingFollowers) {
//        long seconds = DateTimeUtils.currentTimeSecond();
//
//        jdbcTemplate.batchUpdate("INSERT INTO " +
//                "`tiktok`.`ranking_followers`" +
//                "(`blogger_type`, `ranking`, `ranking_type`, `blogger_id`, `uid`," +
//                " `nickname`, `unique_id`, `avatar`, `state`, `position`, " +
//                "`follower`, `follower_growth`, `belong`, `create_time`, " +
//                "`create_by`, `update_time`, `update_by`) " +
//                "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() {
//            @Override
//            public void setValues(PreparedStatement preparedStatement, int i) throws SQLException {
//                RankingFollowers followers = rankingFollowers.get(i);
//                preparedStatement.setLong(1,followers.getBloggerType());
//                preparedStatement.setInt(2,followers.getRanking());
//                preparedStatement.setInt(3,followers.getRankingType());
//                preparedStatement.setLong(4,followers.getBloggerId());
//                preparedStatement.setLong(5,followers.getUid());
//                preparedStatement.setString(6,followers.getNickname());
//                preparedStatement.setString(7,followers.getUniqueId());
//                preparedStatement.setString(8,followers.getAvatar());
//                preparedStatement.setString(9,followers.getState());
//                preparedStatement.setInt(10,followers.getPosition());
//                preparedStatement.setInt(11,followers.getFollower());
//                preparedStatement.setInt(12,followers.getFollowerGrowth());
//                preparedStatement.setInt(13,followers.getBelong());
//                preparedStatement.setLong(14,seconds);
//                preparedStatement.setString(15,followers.getCreateBy());
//                preparedStatement.setLong(16,seconds);
//                preparedStatement.setString(17,followers.getUpdateBy());
//            }
//
//            @Override
//            public int getBatchSize() {
//                return rankingFollowers.size();
//            }
//        });
//    }
//}
